package com.dream.oproject.demo.dao;

import junit.framework.TestCase;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.dream.oproject.demo.dao.impl.DemoInfoDao;
import com.dream.oproject.demo.model.DemoInfo;
import com.dream.oproject.demo.service.IDemoInfoService;


@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"/applicationContext.xml","/applicationContext-database.xml"})
public class DemoDaoCase  extends TestCase{
	
	@Autowired
	private DemoInfoDao demoInfoDao;
	
	@Test
	public void testDelBlog(){
		for(int i=0;i<10;i++){
		DemoInfo demoInfo = new DemoInfo();
		demoInfo.setDemoDouble(new Double(3.9+i));
		demoInfo.setName("test"+i);
		demoInfo.setDemoNum(i);
		demoInfo.setDemoText("ffffffffffffff"+i);
		
		demoInfoDao.save(demoInfo);
		System.out.println(demoInfo.getOid());
		}
	}
}
